package Pet.Management.domain.dto;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * 消息数据传输对象
 */
public class MessageDTO {
    private Long id;
    private String title;
    private String content;
    private String sender; // 发送者用户名
    private Long senderId; // 发送者ID
    private String type; // 消息类型：system, private, like, comment
    private Boolean isRead; // 是否已读
    private LocalDateTime time; // 消息时间
    private Map<String, String> extra = new HashMap<>(); // 额外信息，如头像、链接等
    
    // Getters and Setters
    
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public String getTitle() {
        return title;
    }
    
    public void setTitle(String title) {
        this.title = title;
    }
    
    public String getContent() {
        return content;
    }
    
    public void setContent(String content) {
        this.content = content;
    }
    
    public String getSender() {
        return sender;
    }
    
    public void setSender(String sender) {
        this.sender = sender;
    }
    
    public Long getSenderId() {
        return senderId;
    }
    
    public void setSenderId(Long senderId) {
        this.senderId = senderId;
    }
    
    public String getType() {
        return type;
    }
    
    public void setType(String type) {
        this.type = type;
    }
    
    public Boolean getIsRead() {
        return isRead;
    }
    
    public void setIsRead(Boolean isRead) {
        this.isRead = isRead;
    }
    
    public LocalDateTime getTime() {
        return time;
    }
    
    public void setTime(LocalDateTime time) {
        this.time = time;
    }
    
    public Map<String, String> getExtra() {
        return extra;
    }
    
    public void setExtra(Map<String, String> extra) {
        this.extra = extra;
    }
    
    // 便捷方法：添加额外信息
    public void addExtra(String key, String value) {
        if (this.extra == null) {
            this.extra = new HashMap<>();
        }
        this.extra.put(key, value);
    }
} 